<?php error_reporting (E_ALL ^ E_NOTICE);   // Remove unneeded notices ?> 

<?php
    // Name: Justin Lee and Alexander Cam Liu
    // Modded code from cas-demo.php by Russell Tokuyama
    include 'phpfunctions.php';  // include Russell's php header code
?>

<?php if(isset($_SESSION['name'])) { // Check to see if user is logged in
?>    

    <!DOCTYPE html>

    <html>
    <head>
        <title>Post Book Form</title>
        <!-- Bootstrap -->
        <link href="css/bootstrap.css" rel="stylesheet">
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <link href="css/docs.css" rel="stylesheet">
        <script src="js/infogenerate.js"></script>
    </head>

    <body>
        <div class="navbar navbar-fixed-top">
          <div class="navbar-inner">
            <div class="container-fluid">
              <a class="brand" href="#"><?php echo $name ?></a>
              <div class="nav-collapse collapse">
                <ul class="nav">
                  <li><a href="<?php echo $logout; ?>">Logout</a></li>
                </ul>
              </div>
            </div>
          </div>
        </div>
        <br>
        <div class="container">
            
            <form id="book_form" action="bookinfo.php" method="post">

                <div class="row">
                    <div class="span4 offset3">
                        <label> Book: </label>
                        <input type="text" id="book" name="book"  width="30" height="30" required>
                         
                        <label> Author: </label>
                        <input type="text" id="author" name="author"  required>

                        <label> ISSN: </label>
                        <input type="text" id="issn" name="issn">

                        <label> Edition: </label>
                        <input type="text" id="edition" name="edition">
                    </div>

                    <div class="span4">
                        <label> Class: </label>
                        <input type="text" id="class" name="class">

                        <label> Professor: </label>
                        <input type="text" id="professor" name="professor">

                        <label> PRICE: </label>
                        <input type="text" id="price" name="price" pattern="\d+\.\d{2}" required>

                        <label> Description: </label>
                        <textarea id="description" name="description"></textarea>
                    </div>
                </div>
                <br>
                <div class ="span4 offset4">
                    <input class="btn btn-large btn-block btn-primary" type="submit" />
                </div>
            </form>
        </div> <!-- /container -->
    </body>
    </html>

<?php
    } else {
        header("Location: $login");
    }
?>